Skip to content

feat(microvmtest): add untagged microVM test gate package - #503

Merged
mattwilkinsonn merged 1 commit into
mainfrom
compass-runner/rig-2520-microvmtest-gate
Aug 23, 2026
Merged

feat(microvmtest): add untagged microVM test gate package#503
mattwilkinsonn merged 1 commit into
mainfrom
compass-runner/rig-2520-microvmtest-gate

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 3 PRs:

  1. main
  2. "feat(microvmtest): add untagged microVM test gate package" (this PR)
  3. feat(guest-image): microVM guest kernel + rootfs derivations and moon build gate #507
  4. ci(microvm): GHA KVM leg + tagged microVM canary #512

Add go/internal/microvmtest, the shared runtime gate the two-tier tag rule requires. Require(t) probes whether /dev/kvm is openable by the current uid, skips with a named reason when it is not, and hard-fails when COMPASS_REQUIRE_MICROVM is set — the pgtest RequireDSN/COMPASS_REQUIRE_LIVE posture, so a KVM-less CI leg reds rather than silently passing.

The pure decideKVMSource decision function is split from the *testing.T dispatch (mirroring decideDSNSource) so the policy is unit-testable without real hardware; the /dev/kvm open probe is injected as a bool, kept out of the pure function.

Unlike pgtest, the package's non-test files compile UNTAGGED so the moon battery type-checks the gate everywhere. The //go:build microvm && unix tag lives in the consuming V2a+ integration tests, which call microvmtest.Require(t) first; this package is the untagged shared gate they import.

Refs RIG-2520

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Aug 22, 2026

Copy link
Copy Markdown

RIG-2520

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-runner-rig-2520-micr.compass-eng-docs.pages.dev

Deployed from compass-runner/rig-2520-microvmtest-gate at 4acbc88.

@rigel-mintaka
rigel-mintaka force-pushed the compass-runner/rig-2520-microvmtest-gate branch from 5c963d8 to 3855996 Compare August 23, 2026 00:17
Add `go/internal/microvmtest`, the shared runtime gate the two-tier tag rule requires. `Require(t)` probes whether `/dev/kvm` is openable by the current uid, skips with a named reason when it is not, and hard-fails when `COMPASS_REQUIRE_MICROVM` is set — the pgtest `RequireDSN`/`COMPASS_REQUIRE_LIVE` posture, so a KVM-less CI leg reds rather than silently passing.

The pure `decideKVMSource` decision function is split from the `*testing.T` dispatch (mirroring `decideDSNSource`) so the policy is unit-testable without real hardware; the `/dev/kvm` open probe is injected as a bool, kept out of the pure function.

Unlike pgtest, the package's non-test files compile UNTAGGED so the moon battery type-checks the gate everywhere. The `//go:build microvm && unix` tag lives in the consuming V2a+ integration tests, which call `microvmtest.Require(t)` first; this package is the untagged shared gate they import.

Refs RIG-2520

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@mattwilkinsonn
mattwilkinsonn merged commit 6840479 into main Aug 23, 2026
10 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-runner/rig-2520-microvmtest-gate branch August 23, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants